{% extends "base.html" %}
{% block title %}{{ user.get_full_name }}{% endblock %}
{% block content %}
    <h1>{{ user.get_full_name }}</h1>
    <div class="profile-info">
    {% if user.profile.photo %}
    <img src="{{ user.profile.photo.url }}">
    {% endif %}
    </div>
    {% with total_followers=user.followers.count %}
    <span class="count">
        <span class="total">{{ total_followers }}</span>
        follower{{ total_followers|pluralize }}
    </span>
    {% if request.user != user %}
        {% if request.user in user.followers.all %}
        <a href="{% url 'unfollow' username=user.username %}" class="followbutton">
            UnFollow
        </a>
        {% else %}
        <a href="{% url 'follow' username=user.username %}" class="followbutton">
            Follow
        </a>
        {% endif %}
    {% endif %}
    {% endwith %}
{% endblock %}